<template>
	<view>
		<navNav :navobj="navobj"></navNav>
		
		<scroll-view class="scroll-view" scroll-y="true" refresher-enabled="true"
		 :refresher-triggered="triggered" refresher-background="#fff" 
		 @refresherrefresh="pulldown" @scrolltolower="scrolltolower" >
			<view class="box">
				<view class="boxon">
					<view class="left">
						<image src="/static/logo.png" mode="aspectFill"></image>
						<view class="left-down">
							<view class="title">用户123</view>
							<view class="time">2023-4-23</view>
						</view>
					</view>
				  <uni-rate :readonly="true" v-model="xingxing" />
				</view>
				<view class="content">
					这是我见过最好的师傅，维修快，为人热情，推荐大伙给他订单
				</view>
				<view class="imglist">
					<image v-for="(item,index) in 6" src="/static/logo.png" mode="aspectFill"></image>
				</view>
				
				<view style="display: flex;justify-content: space-between;margin-top: 50rpx;">
					<view style="width: 10rpx;"></view>
					<view style="text-align: center;line-height:54rpx; font-weight: 400;font-size: 24rpx;color: #FFFFFF;width: 156rpx;height: 54rpx;background: #3662EC;border-radius:40rpx;">查看详情</view>
				</view>
			</view>
			
			
			
		
			<view style="height: 100rpx;"></view>
		</scroll-view>
	</view>
</template>

<script setup>
	import {reactive, ref,getCurrentInstance} from 'vue'
	import {onLoad} from "@dcloudio/uni-app"
	const {proxy} = getCurrentInstance()
  const xingxing = ref(5)
	const navobj = reactive({
		title:'评价记录',
		image:true
	})
	const lists = ref({
		list:[],
		total:0
	})
	const scrollobj = reactive({
		triggered:false,
		pageNum:1,
		pageSize:10,
		isloading:false,
		total:0,
		isjz:false,
		pulldown:false
	})
	//列表请求
	const contentListfun=async()=>{
		return
		scrollobj.isloading = true
		var data = {
			pageNum:scrollobj.pageNum,
			pageSize:scrollobj.pageSize,
			flowStatus:'PENDING_REV',
		}
		const result = await proxy.$api.contentlistAPi(data)
		if(result.code==200){
			console.log('服务订单列表',result);
			scrollobj.isloading = false
			if(result.rows.length>0){
				lists.list = [...lists.list,...result.rows]
			}
			uni.hideLoading()
			lists.total = result.total
		}
	}
	// 下拉刷新
	const pulldown=()=>{
		scrollobj.triggered=true
		scrollobj.pageNum = 1
		lists.list = []
		contentListfun()
	}
	//上拉加载
	const scrolltolower=()=>{
		if (scrollobj.total < 10) {
			proxy.$showToast('没有更多了')
			return
		}
		if (scrollobj.isloading) return;
			scrollobj.pageNum++;
			uni.showLoading({
				title: '加载中'
			});
		// 执行的函数↓
		contentListfun()
	}
</script>

<style lang="scss">
page{
	overflow: hidden;
}
.scroll-view{
		height: 100vh;width: 750rpx;margin: 0 auto;background-color: #f5f5f5;padding-top: 30rpx;
		.box{
			width: 710rpx;margin: 0 auto;background-color: #fff;padding: 30rpx 20rpx;
			box-sizing: border-box;border-radius: 10rpx;margin-bottom: 30rpx;
			.boxon{
				display: flex;align-items: center;justify-content: space-between;
				.left{
					display: flex;align-items: center;
					image{
						width: 80rpx;height: 80rpx;border-radius: 100%;margin-right: 10rpx;
					}
					.left-down{
						display: flex;flex-direction: column;justify-content: center;
						.title{
							font-size: 28rpx;font-weight: bold;
						}
						.time{
							font-size: 24rpx;color: #ccc;
						}
					}
				}
			}
			.content{
				margin-top: 20rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: rgba(0,0,0,0.6);
			}
			.imglist{
				display: flex;align-items: center;flex-wrap: wrap;
				image{
					width: 100rpx;height: 100rpx;margin-right: 20rpx;margin-top: 20rpx;
				}
			}
			
		}
	}
</style>
